<template>
  <div class="yuan_item_wrap">
    <el-form
      :model="commonG6FromObj"
      ref="ruleForm"
      label-width="110px"
      class="demo-ruleForm"
    >
      <el-form-item label="源类型" prop="type">
        <el-select v-model="commonG6FromObj.type" placeholder="请选择源类型">
          <el-option label="数据库" value="数据库"></el-option>
          <el-option label="FTP" value="FTP"></el-option>
          <el-option label="Hadoop" value="Hadoop"></el-option>
          <el-option label="kafka" value="kafka"></el-option>
        </el-select>
      </el-form-item>
      <div v-if="commonG6FromObj.type === '数据库'">
        <el-form-item label="名称" prop="name">
          <el-input v-model="commonG6FromObj.name"></el-input>
        </el-form-item>
        <el-form-item label="IP" prop="IP">
          <el-input v-model="commonG6FromObj.IP"></el-input>
        </el-form-item>
        <el-form-item label="端口" prop="duankou">
          <el-input v-model="commonG6FromObj.duankou"></el-input>
        </el-form-item>
        <el-form-item label="用户名" prop="userName">
          <el-input v-model="commonG6FromObj.userName"></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="password">
          <el-input v-model="commonG6FromObj.password"></el-input>
        </el-form-item>
        <el-form-item label="数据库类型" prop="type">
          <el-select
            v-model="commonG6FromObj.dataType"
            placeholder="请选择数据库类型"
          >
            <el-option label="MySQL" value="MySQL"></el-option>
            <el-option label="Oracle" value="Oracle"></el-option>
            <el-option label="SQL-Server" value="Server"></el-option>
            <el-option label="HIVE" value="HIVE"></el-option>
          </el-select>
        </el-form-item>
      </div>
      <div v-if="commonG6FromObj.type === 'FTP'">
        <el-form-item label="名称" prop="name">
          <el-input v-model="commonG6FromObj.name"></el-input>
        </el-form-item>
        <el-form-item label="地址" prop="url">
          <el-input v-model="commonG6FromObj.url"></el-input>
        </el-form-item>
        <el-form-item label="协议" prop="xieyi">
          <el-select v-model="commonG6FromObj.xieyi" placeholder="请选择协议">
            <el-option label="客户端" value="客户端"></el-option>
            <el-option label="服务器" value="服务器"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="用户名" prop="userName">
          <el-input v-model="commonG6FromObj.userName"></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="password">
          <el-input v-model="commonG6FromObj.password"></el-input>
        </el-form-item>
      </div>
      <div v-if="commonG6FromObj.type === 'Hadoop'">
        <el-form-item label="名称" prop="name">
          <el-input v-model="commonG6FromObj.name"></el-input>
        </el-form-item>
        <el-form-item label="IP" prop="IP">
          <el-input v-model="commonG6FromObj.IP"></el-input>
        </el-form-item>
        <el-form-item label="端口" prop="duankou">
          <el-input v-model="commonG6FromObj.duankou"></el-input>
        </el-form-item>
        <el-form-item label="接口" prop="jiekou">
          <el-input v-model="commonG6FromObj.jiekou"></el-input>
        </el-form-item>
        <el-form-item label="用户名" prop="userName">
          <el-input v-model="commonG6FromObj.userName"></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="password">
          <el-input v-model="commonG6FromObj.password"></el-input>
        </el-form-item>
      </div>
      <div v-if="commonG6FromObj.type === 'kafka'">
        <el-form-item label="名称" prop="name">
          <el-input v-model="commonG6FromObj.name"></el-input>
        </el-form-item>
        <el-form-item label="IP" prop="IP">
          <el-input v-model="commonG6FromObj.IP"></el-input>
        </el-form-item>
        <el-form-item label="端口" prop="duankou">
          <el-input v-model="commonG6FromObj.duankou"></el-input>
        </el-form-item>
        <el-form-item label="用户名" prop="userName">
          <el-input v-model="commonG6FromObj.userName"></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="password">
          <el-input v-model="commonG6FromObj.password"></el-input>
        </el-form-item>
        <el-form-item label="动作类型" prop="actType">
          <el-select
            v-model="commonG6FromObj.actType"
            placeholder="请选择动作类型"
          >
            <el-option label="网页浏览" value="网页浏览"></el-option>
            <el-option label="网页搜索" value="网页搜索"></el-option>
            <el-option label="其他行动" value="其他行动"></el-option>
          </el-select>
        </el-form-item>
      </div>
    </el-form>
  </div>
</template>
<script>
export default {
  props: {
    commonG6FromObj: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {};
  },
  methods: {
    btnChange() {
      var file = document.getElementById("file");
      file.click();
    },
  },
};
</script>
<style scoped lang="scss"></style>
